Skip to content

feat(components): added Markdown component (#DS-5225) - #447

Merged
artembelik merged 4 commits into
mainfrom
feat/DS-5225
Aug 7, 2026
Merged

feat(components): added Markdown component (#DS-5225)#447
artembelik merged 4 commits into
mainfrom
feat/DS-5225

Conversation

@artembelik

@artembelik artembelik commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added an experimental Markdown component with GitHub Flavored Markdown support.
    • Supports headings, lists, tables, links, images, blockquotes, code blocks, and other common Markdown elements.
    • Added styling, ref forwarding, custom classes, and standard container properties.
    • Added a public markdown package export.
  • Documentation

    • Added usage guidance, examples, and Storybook coverage for Markdown content.
  • Bug Fixes

    • Sanitizes raw HTML in rendered Markdown content.

@artembelik artembelik self-assigned this Aug 6, 2026
Copilot AI lite review requested due to automatic review settings August 6, 2026 09:40
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 21437c4d-932a-46ae-80c7-c795fe558d92

📥 Commits

Reviewing files that changed from the base of the PR and between 9de1109 and 979cebe.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • package.json
  • packages/components/package.json
  • packages/components/src/components/Markdown/Markdown.mdx
  • packages/components/src/components/Markdown/Markdown.module.css
  • packages/components/src/components/Markdown/Markdown.stories.tsx
  • packages/components/src/components/Markdown/Markdown.test.tsx
  • packages/components/src/components/Markdown/Markdown.tsx
  • packages/components/src/markdown.ts
  • packages/components/src/styles/mixins.css
  • packages/components/vite.config.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/components/src/components/Markdown/Markdown.mdx
  • packages/components/src/components/Markdown/Markdown.tsx
  • packages/components/src/components/Markdown/Markdown.module.css
  • packages/components/src/components/Markdown/Markdown.test.tsx

📝 Walkthrough

Walkthrough

Adds an experimental Markdown component backed by react-markdown and remark-gfm. It adds typed exports, package build entries, typography styling, Storybook examples, API metadata, and rendering tests.

Changes

Markdown component

Layer / File(s) Summary
Dependencies and public contract
package.json, packages/components/package.json, packages/components/src/components/Markdown/types.ts, packages/components/src/components/Markdown/index.ts, packages/components/src/markdown.ts, packages/components/vite.config.ts, tools/api-extractor/config.json, tools/public_api_guard/components/Markdown.api.md
Adds parser dependencies, defines MarkdownProps, configures the markdown build entry, and exposes the component through package exports and API reports.
GFM parsing and rendering
packages/components/src/components/Markdown/Markdown.tsx
Renders string Markdown content with react-markdown and remark-gfm. Forwards an HTMLDivElement ref, merges classes, and passes through div props.
Markdown presentation and examples
packages/components/src/components/Markdown/Markdown.module.css, packages/components/src/styles/mixins.css, packages/components/src/components/Markdown/Markdown.mdx, packages/components/src/components/Markdown/Markdown.stories.tsx
Adds Markdown typography and element styles. Documents supported syntax and adds Storybook stories for individual elements and a complete article.
Markdown behavior validation
packages/components/src/components/Markdown/Markdown.test.tsx
Tests server rendering, refs, classes, Markdown elements, updates, raw HTML handling, and fenced-code language classes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: enhancement

Suggested reviewers: kamilemeleev

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant Markdown
  participant ReactMarkdown
  Consumer->>Markdown: Provide Markdown children and div props
  Markdown->>ReactMarkdown: Parse content with remark-gfm
  ReactMarkdown-->>Markdown: Return rendered element tree
  Markdown-->>Consumer: Render styled Markdown content
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of the Markdown component, which is the primary change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/DS-5225

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Stylelint (17.14.0)
packages/components/src/components/Markdown/Markdown.module.css

ConfigurationError: Could not find "stylelint-config-css-modules". Do you need to install the package or use the "configBasedir" option?
at getModulePath (file:///usr/local/lib/node_modules/stylelint/lib/utils/getModulePath.mjs:38:9)
at loadExtendedConfig (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:285:21)
at extendConfig (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:252:25)
at async augmentConfigBasic (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:85:20)
at async augmentConfigFull (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:138:24)
at async getConfigForFile (file:///usr/local/lib/node_modules/stylelint/lib/getConfigForFile.mjs:102:26)
at async resolveOptionValue (file:///usr/local/lib/node_modules/stylelint/lib/utils/resolveOptionValue.mjs:27:24)
at async standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:127:22)

packages/components/src/styles/mixins.css

ConfigurationError: Could not find "stylelint-config-css-modules". Do you need to install the package or use the "configBasedir" option?
at getModulePath (file:///usr/local/lib/node_modules/stylelint/lib/utils/getModulePath.mjs:38:9)
at loadExtendedConfig (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:285:21)
at extendConfig (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:252:25)
at async augmentConfigBasic (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:85:20)
at async augmentConfigFull (file:///usr/local/lib/node_modules/stylelint/lib/augmentConfig.mjs:138:24)
at async getConfigForFile (file:///usr/local/lib/node_modules/stylelint/lib/getConfigForFile.mjs:102:26)
at async resolveOptionValue (file:///usr/local/lib/node_modules/stylelint/lib/utils/resolveOptionValue.mjs:27:24)
at async standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:127:22)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 979cebe):

https://react-koobiq-next--prs-447-2v2xguuh.web.app

(expires Wed, 12 Aug 2026 13:45:09 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/components/package.json`:
- Around line 45-56: Update the dependency declarations in package.json so
dompurify and marked are required rather than optional peer dependencies, since
Markdown directly imports them. Remove their optional peer metadata while
preserving the existing Markdown export behavior.

In `@packages/components/src/components/Markdown/types.ts`:
- Around line 5-7: Update MarkdownProps in
packages/components/src/components/Markdown/types.ts to omit
dangerouslySetInnerHTML alongside children. In
packages/components/src/components/Markdown/Markdown.tsx, destructure and
discard dangerouslySetInnerHTML before spreading the remaining props onto the
div. Regenerate tools/public_api_guard/components/Markdown.api.md so the public
API reflects the updated type.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e62241d-b177-4229-9755-ebb327fb4469

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf6163 and 1cd3c75.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • package.json
  • packages/components/package.json
  • packages/components/src/components/Markdown/Markdown.mdx
  • packages/components/src/components/Markdown/Markdown.module.css
  • packages/components/src/components/Markdown/Markdown.stories.tsx
  • packages/components/src/components/Markdown/Markdown.test.tsx
  • packages/components/src/components/Markdown/Markdown.tsx
  • packages/components/src/components/Markdown/index.ts
  • packages/components/src/components/Markdown/types.ts
  • packages/components/src/components/index.ts
  • tools/api-extractor/config.json
  • tools/public_api_guard/components/Markdown.api.md

Comment thread packages/components/package.json Outdated
Comment thread packages/components/src/components/Markdown/types.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Markdown component to @koobiq/react-components, exposing it via the package public API and Storybook docs/stories, using marked for parsing and DOMPurify for sanitization.

Changes:

  • Introduces Markdown component implementation, styles, types, tests, stories, and MDX documentation.
  • Exposes the component through the components barrel exports and updates API Extractor config + API report.
  • Adds marked and dompurify to the workspace lockfile and declares them as peer dependencies of @koobiq/react-components.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/public_api_guard/components/Markdown.api.md Adds the generated API Extractor report for the new component.
tools/api-extractor/config.json Registers Markdown for API Extractor/public API guarding.
pnpm-lock.yaml Locks new dependencies (marked, dompurify) and related graph updates.
packages/components/src/components/Markdown/types.ts Defines the public MarkdownProps type surface.
packages/components/src/components/Markdown/Markdown.tsx Implements Markdown-to-HTML rendering + sanitation and class injection.
packages/components/src/components/Markdown/Markdown.test.tsx Adds unit tests for rendering, options, and sanitization behavior.
packages/components/src/components/Markdown/Markdown.stories.tsx Adds Storybook stories covering common Markdown structures.
packages/components/src/components/Markdown/Markdown.module.css Adds CSS module styles for rendered Markdown elements.
packages/components/src/components/Markdown/Markdown.mdx Adds Storybook documentation page for the new component.
packages/components/src/components/Markdown/index.ts Exports the component and its types from the component folder.
packages/components/src/components/index.ts Re-exports Markdown from the components barrel.
packages/components/package.json Declares marked/dompurify as peer deps (currently marked optional).
package.json Adds marked/dompurify to the workspace root dependencies for development/tooling.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/components/src/components/Markdown/Markdown.tsx Outdated
Comment thread packages/components/package.json
Comment thread packages/components/package.json Outdated
Comment thread packages/components/src/components/Markdown/Markdown.stories.tsx Outdated
Comment thread packages/components/src/components/Markdown/Markdown.tsx Outdated
Comment thread packages/components/src/components/Markdown/Markdown.tsx Outdated
Comment thread packages/components/src/components/Markdown/Markdown.mdx Outdated
Comment thread packages/components/src/components/Markdown/Markdown.module.css Outdated
Comment thread packages/components/src/components/Markdown/Markdown.tsx Outdated
@artembelik
artembelik merged commit 43af5a8 into main Aug 7, 2026
7 checks passed
@artembelik
artembelik deleted the feat/DS-5225 branch August 7, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants